package com.NetSunWeiQin.chapter03;

import java.io.*;
import java.net.*;


/**
 *
 * 验证 serverSocket 的随机端口
 * */
public class RandomPort{
  public static void main(String args[])throws IOException{
    ServerSocket serverSocket=new ServerSocket(0);
    System.out.println("随机的端口是: "+serverSocket.getLocalPort());
  }
}



